package com.beijing.cyou.service.impl;

import java.util.List;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.beijing.cyou.mapper.SMSBalanceMapper;
import com.beijing.cyou.model.SMSBalance;
import com.beijing.cyou.params.SMSParams;
import com.beijing.cyou.service.SMSBalanceService;
import com.beijing.cyou.utils.NotNullHelps;

@Slf4j
@Service
public class SMSBalanceServiceImpl implements SMSBalanceService {

	@Autowired
	private SMSBalanceMapper balanceMapper ;
	
	private String message ;
	
	@Override
	public SMSBalance getSMSInfoById(Long id) {
		SMSBalance balance = balanceMapper.getSMSInfoById(id);
		message = NotNullHelps.isNotNull(balance) ? "## 查询信息成功 $$" : "%% 信息不存在！ @@";
		log.info(message);
		return balance;
	}

	@Override
	public List<SMSBalance> listSMSInfoList(SMSParams condition) {
		List<SMSBalance> balanceList = balanceMapper.listSMSInfoByBalance(condition);
		return balanceList;
	}

}
